<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统(TelecomEC)</title>
<script>
	var mainDomain = "${mainDomain}";
	var miscDomain = '${mainDomain}';
</script>
</head>
<body >
	<table id="tt" border="2px" ></table>

	<script type="text/javascript" >
	
	$(document).ready(
			getPoolInfo()
	);
		
	function getPoolInfo(){
				var tableHead = '<tr><th>数据源名称</th><th>有效连接数</th><th>连接总数</th><th>操作</th></tr>';
				var tableBody = [];
				$.post("${mainDomain}/getPoolInfo.action",null,function(rs){
					if(rs){
						$.each(rs,function(i,v){
							tableBody.push('<tr><td>'+this.resourceName+'</td><td>'+this.poolAvailableSize+'</td><td>'+this.poolTotalSize+'</td><td>');
							tableBody.push('<input type="button"  onclick="getPoolInfo();" value="刷新数据" />');
//							tableBody.push('<input type="button"  onclick="getNewConnection('+this.resourceName+');" value="创建新连接" />');
							tableBody.push('</td></tr>');
						});
					}
					$("#tt").empty().html(tableHead+tableBody.join(""));
				},'json');
				
			};
	
		function getNewConnection(resourceName){
			var tableHead = '<tr><th>数据源名称</th><th>有效连接数</th><th>连接总数</th><th>操作</th></tr>';
			var tableBody = [];
			$.post("${mainDomain}/getNewConnection.action?resourceName="+resourceName,null,function(rs){
				if(rs){
					$.each(rs,function(i,v){
						tableBody.push('<tr><td>'+this.resourceName+'</td><td>'+this.poolAvailableSize+'</td><td>'+this.poolTotalSize+'</td><td>');
						tableBody.push('<input type="button"  onclick="getPoolInfo();" value="刷新数据" />');
//						tableBody.push('<input type="button"  onclick="getNewConnection('+this.resourceName+');" value="创建新连接" />');
						tableBody.push('</td></tr>');
					});
				}
				$("#tt").empty().html(tableHead+tableBody.join(""));
			},'json');
		};
	</script>
</body>
</html>